package com.sc.VenusQueryBeta.adapter.home;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sc.VenusQueryBeta.R;
import com.sc.VenusQueryBeta.adapter.BaseCompatAdapter;
import com.sc.VenusQueryBeta.api.Host;
import com.sc.VenusQueryBeta.global.MyApplication;
import com.sc.VenusQueryBeta.model.bean.home.SearchListBean;

import java.util.List;

/**
 * Created by Administrator on 10/10/2018.
 * 首页热门活动列表适配器
 */

public class SearchActivityListAdapter extends BaseCompatAdapter<SearchListBean.DataBean, BaseViewHolder> {


    public SearchActivityListAdapter(int layoutResId, @Nullable List<SearchListBean.DataBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, SearchListBean.DataBean item) {
        helper.setText(R.id.detail,item.getTitle());
        ImageView iv = helper.getView(R.id.iv);
        Glide.with(MyApplication.app).load(Host.HostImg+item.getImageUrl()).diskCacheStrategy(DiskCacheStrategy.SOURCE).dontAnimate()
                .into(iv);
    }
}
